<?php
if (isset($_POST['vtd']) && isset($_POST['uid'])){
    include '../c/config.php';
   
    $mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
    if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqliTwo->error);}
    $id=substr(trim($_POST['vtd']), 3);
    $queryJ=$mysqli->query("SELECT id from `uinfo_sim` where id='".$id."' limit 0,1 ");
    if($queryJ->num_rows>0){
        $getidD=$queryJ->fetch_assoc();
        $idFile='../data/user/'.$getidD['id'].'.txt';
        if (file_exists($idFile)){
            $getU=json_decode(file_get_contents($idFile),true);
        }else{
            $query=$mysqli->query("SELECT * from `uinfo` where id=".$getidD['id']." limit 0,1 ");
            $getU=$query->fetch_assoc();
        }
        echo json_encode(array('s'=>'y','u'=>$getU));
    }else{
        echo json_encode(array('s'=>'n'));
    }
    $mysqli->close();
    exit;
}
